Optimal. Leaf size=187 \[ -\frac {64 a^4 \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {136 a^4 \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{21 d}+\frac {64 a^4 \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {94 a^4 \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{21 d}+\frac {8 a^4 \sec ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{5 d}+\frac {2 a^4 \sec ^{\frac {7}{2}}(c+d x) \sin (c+d x)}{7 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 187, normalized size of antiderivative = 1.00, number of steps
used = 18, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3876, 3856,
2720, 3853, 2719} \begin {gather*} \frac {2 a^4 \sin (c+d x) \sec ^{\frac {7}{2}}(c+d x)}{7 d}+\frac {8 a^4 \sin (c+d x) \sec ^{\frac {5}{2}}(c+d x)}{5 d}+\frac {94 a^4 \sin (c+d x) \sec ^{\frac {3}{2}}(c+d x)}{21 d}+\frac {64 a^4 \sin (c+d x) \sqrt {\sec (c+d x)}}{5 d}+\frac {136 a^4 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{21 d}-\frac {64 a^4 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2719
Rule 2720
Rule 3853
Rule 3856
Rule 3876
Rubi steps
\begin {align*} \int \sqrt {\sec (c+d x)} (a+a \sec (c+d x))^4 \, dx &=\int \left (a^4 \sqrt {\sec (c+d x)}+4 a^4 \sec ^{\frac {3}{2}}(c+d x)+6 a^4 \sec ^{\frac {5}{2}}(c+d x)+4 a^4 \sec ^{\frac {7}{2}}(c+d x)+a^4 \sec ^{\frac {9}{2}}(c+d x)\right ) \, dx\\ &=a^4 \int \sqrt {\sec (c+d x)} \, dx+a^4 \int \sec ^{\frac {9}{2}}(c+d x) \, dx+\left (4 a^4\right ) \int \sec ^{\frac {3}{2}}(c+d x) \, dx+\left (4 a^4\right ) \int \sec ^{\frac {7}{2}}(c+d x) \, dx+\left (6 a^4\right ) \int \sec ^{\frac {5}{2}}(c+d x) \, dx\\ &=\frac {8 a^4 \sqrt {\sec (c+d x)} \sin (c+d x)}{d}+\frac {4 a^4 \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{d}+\frac {8 a^4 \sec ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{5 d}+\frac {2 a^4 \sec ^{\frac {7}{2}}(c+d x) \sin (c+d x)}{7 d}+\frac {1}{7} \left (5 a^4\right ) \int \sec ^{\frac {5}{2}}(c+d x) \, dx+\left (2 a^4\right ) \int \sqrt {\sec (c+d x)} \, dx+\frac {1}{5} \left (12 a^4\right ) \int \sec ^{\frac {3}{2}}(c+d x) \, dx-\left (4 a^4\right ) \int \frac {1}{\sqrt {\sec (c+d x)}} \, dx+\left (a^4 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 a^4 \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {64 a^4 \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {94 a^4 \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{21 d}+\frac {8 a^4 \sec ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{5 d}+\frac {2 a^4 \sec ^{\frac {7}{2}}(c+d x) \sin (c+d x)}{7 d}+\frac {1}{21} \left (5 a^4\right ) \int \sqrt {\sec (c+d x)} \, dx-\frac {1}{5} \left (12 a^4\right ) \int \frac {1}{\sqrt {\sec (c+d x)}} \, dx+\left (2 a^4 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx-\left (4 a^4 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx\\ &=-\frac {8 a^4 \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {6 a^4 \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {64 a^4 \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {94 a^4 \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{21 d}+\frac {8 a^4 \sec ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{5 d}+\frac {2 a^4 \sec ^{\frac {7}{2}}(c+d x) \sin (c+d x)}{7 d}+\frac {1}{21} \left (5 a^4 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx-\frac {1}{5} \left (12 a^4 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx\\ &=-\frac {64 a^4 \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {136 a^4 \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{21 d}+\frac {64 a^4 \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {94 a^4 \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{21 d}+\frac {8 a^4 \sec ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{5 d}+\frac {2 a^4 \sec ^{\frac {7}{2}}(c+d x) \sin (c+d x)}{7 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 4 in
optimal.
time = 2.63, size = 279, normalized size = 1.49 \begin {gather*} \frac {a^4 \sec ^8\left (\frac {1}{2} (c+d x)\right ) (1+\sec (c+d x))^4 \left (-\frac {4 i \sqrt {2} e^{-i (c+d x)} \sqrt {\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}} \cos ^4(c+d x) \left (168 \left (1+e^{2 i (c+d x)}\right )+168 \left (-1+e^{2 i c}\right ) \sqrt {1+e^{2 i (c+d x)}} \, _2F_1\left (-\frac {1}{4},\frac {1}{2};\frac {3}{4};-e^{2 i (c+d x)}\right )+85 e^{i (c+d x)} \left (-1+e^{2 i c}\right ) \sqrt {1+e^{2 i (c+d x)}} \, _2F_1\left (\frac {1}{4},\frac {1}{2};\frac {5}{4};-e^{2 i (c+d x)}\right )\right )}{-1+e^{2 i c}}+\frac {672 \cos (d x) \csc (c)+\left (235+84 \sec (c+d x)+15 \sec ^2(c+d x)\right ) \tan (c+d x)}{\sec ^{\frac {7}{2}}(c+d x)}\right )}{840 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(438\) vs.
\(2(211)=422\).
time = 0.11, size = 439, normalized size = 2.35
method | result | size |
default | \(-\frac {a^{4} \sqrt {-\left (-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (\frac {2024 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{105 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}-\frac {\cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}{28 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{2}\right )^{4}}-\frac {47 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}{21 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{2}\right )^{2}}-\frac {2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}{5 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{2}\right )^{3}}-\frac {128 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )}{5 \sqrt {-\left (-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}}-\frac {64 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, \left (\EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-\EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right )}{5 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(439\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 1.15, size = 215, normalized size = 1.15 \begin {gather*} -\frac {2 \, {\left (170 i \, \sqrt {2} a^{4} \cos \left (d x + c\right )^{3} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) - 170 i \, \sqrt {2} a^{4} \cos \left (d x + c\right )^{3} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + 336 i \, \sqrt {2} a^{4} \cos \left (d x + c\right )^{3} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 336 i \, \sqrt {2} a^{4} \cos \left (d x + c\right )^{3} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) - \frac {{\left (672 \, a^{4} \cos \left (d x + c\right )^{3} + 235 \, a^{4} \cos \left (d x + c\right )^{2} + 84 \, a^{4} \cos \left (d x + c\right ) + 15 \, a^{4}\right )} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}}\right )}}{105 \, d \cos \left (d x + c\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^4\,\sqrt {\frac {1}{\cos \left (c+d\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________